<template>
  <div id="app">
    <!-- Header -->
    <header class="header can-sticky">
      <el-row type="flex" justify="space-between" align="middle" class="container">
        <el-col :span="4">
          <div class="logo">
            <a href="/home">
              <img src="@/assets/images/logo.png" alt="logo" />
            </a>
          </div>
        </el-col>
        <el-col :span="32">
          <nav class="navigation">
            <ul class="main-menu">
              <li
                v-for="(item, index) in mainMenu"
                :key="index"
                class="menu-item"
                :class="{ 'menu-item-has-children': !!item.children }"
              >
                <a :href="item.href" @click="handleMenuClick(item, $event)">
                  {{ item.title }}
                </a>

                <!-- 二级菜单 -->
                <ul v-if="item.children" class="sub-menu">
                  <li
                    v-for="(child, childIdx) in item.children"
                    :key="childIdx"
                    class="menu-item"
                    :class="{ 'menu-item-has-children': !!child.children }"
                  >
                    <a :href="child.href" @click="handleMenuClick(child, $event)">
                      {{ child.title }}
                    </a>

                    <!-- 三级菜单 -->
                    <ul v-if="child.children" class="sub-menu">
                      <li
                        v-for="(grandChild, gIdx) in child.children"
                        :key="gIdx"
                        class="menu-item"
                      >
                        <a :href="grandChild.href">{{ grandChild.title }}</a>
                      </li>
                    </ul>
                  </li>
                </ul>
              </li>
            </ul>
          </nav>
        </el-col>
<!--        <el-col :span="4" class="text-right">-->
<!--          <a href="/login" class="header_btn thm-btn btn-rounded btn-small">Log In</a>-->
<!--        </el-col>-->
      </el-row>
    </header>

    <!-- Banner 轮播 -->
    <div class="banner">
      <!-- 轮播主体 -->
      <el-carousel
        ref="carousel"
        :interval="5000"
        arrow="always"
        height="80vh"
        indicator-position="none"
        @change="handleSlideChange"
      >
      <el-carousel-item v-for="(slide, index) in projectSlides" :key="index">
        <div class="slide-item banner_image">
          <img :src="fixImgUrl(slide.coverImage)" class="banner-image" />
          <div class="banner_text">
            <div class="container">
              <div class="text_inner">
                <h1 class="title0">{{ slide.title || 'No Title' }}</h1>
                <p class="subtitle0">{{ slide.subtitle || 'No Subtitle' }}</p>
                <button @click="goToBlogDetails(slide.id)" class="btn-view-details">查看详情</button>
              </div>
            </div>
          </div>
        </div>
      </el-carousel-item>
      </el-carousel>

      <!-- 自定义底部指示器和计数 -->
      <div class="container">
        <div class="row">
          <div class="col-12">
            <div class="dots_counts">
              <!-- 当前页码：格式化为 01 -->
              <div class="slider-count">
                <span class="current">{{ currentSlideStr }}</span>
                <small> / {{ totalSlides }}</small>
              </div>

              <!-- Element UI 的指示器点（居中） -->
              <div class="slick-slider-dots">
                <ul>
                  <li
                    v-for="(slide, idx) in projectSlides"
                    :key="idx"
                    :class="{ active: idx === currentSlide }"
                    @click="goToSlide(idx)"
                  ></li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- About Section -->
    <section class="section-padding section">
      <el-row :gutter="30" type="flex" align="middle">
            <!-- 左侧：图片 -->
            <el-col :md="12" :sm="24">
              <div class="image mb-xl-30">
                <img
                  v-if="aboutItem && aboutItem.coverImage"
                  :src="fixImgUrl(aboutItem.coverImage)"
                  alt="about"
                  class="image-fit"
                />
                </div>
        </el-col>

        <!-- 右侧：内容 -->
        <el-col :md="12" :sm="24">
          <div class="about-content">
            <!-- Section Header -->
            <div class="section-header" v-if="aboutItem">
              <p class="section_count"></p>
              <h3 class="title">{{ aboutItem.title || '关于我们' }}</h3>
              <p>{{ aboutItem.subtitle || '我们致力于提供卓越的服务。' }}</p>
            </div>

            <!-- 按钮 -->
              <button
                v-if="aboutItem && aboutItem.id"
                @click="goToBlogDetails(aboutItem.id)"
                class="btn-view-details">查看详情</button>
          </div>
        </el-col>
      </el-row>
    </section>

    <!-- Services Section -->
    <section class="section-padding section thm-bg-light">
      <div class="container">
        <!-- Section Header -->
        <div class="services">
          <h2>我们的服务</h2>
          <div class="service_boxes">
            <!-- 动态渲染服务项，点击统一跳转到 /services -->
            <a href="/services" class="service_box" v-for="item in services" :key="item.id">
              <div class="contact-icon">
                <img :src="fixImgUrl(item.coverImage)" />
              </div>
              <div class="title">{{ item.title }}</div>
              <p v-html="item.content" class="text"></p>
            </a>

          </div>
        </div>
      </div>
    </section>

    <!-- Footer Start -->
    <footer class="footer">
      <div class="container">
        <el-row :gutter="30" class="content">
          <!-- 公司信息 -->
          <el-col :lg="5" :md="8" :sm="12" :xs="24" class="column">
            <div class="ft_widgets">
              <!-- Logo -->
              <img src="@/assets/images/logo.png" alt="logo" class="logo"/>

              <!-- 描述 -->
              <p class="description" v-html="description"></p>

              <!-- 社交图标 -->
              <ul class="social-icons">
                <li><a href="#" class="icon"><i class="fab fa-facebook-f"></i></a></li>
                <li><a href="#" class="icon"><i class="fab fa-twitter"></i></a></li>
                <li><a href="#" class="icon"><i class="fab fa-instagram"></i></a></li>
                <li><a href="#" class="icon"><i class="fab fa-linkedin-in"></i></a></li>
              </ul>
            </div>
          </el-col>

          <!-- 菜单 -->
          <el-col :lg="3" :md="6" :sm="12" :xs="12" class="column">
            <div class="ft_widgets">
              <h6 class="title1">菜单</h6>
              <ul class="menu">
                <li><a href="/home">首页</a></li>
                <li><a href="/about">关于</a></li>
                <li><a href="/blog-grid">博客</a></li>
                <li><a href="/contact">联系</a></li>
              </ul>
            </div>
          </el-col>

          <!-- 服务 -->
          <el-col :lg="4" :md="6" :sm="12" :xs="12" class="column">
            <div class="ft_widgets">
              <h6 class="title1">服务</h6>
              <ul class="menu">
                <li v-for="item in services" :key="item.id">
                  <a href="/services">{{ item.title }}</a>
                </li>
              </ul>
            </div>
          </el-col>

          <!-- 联系方式 -->
          <el-col :lg="5" :md="8" :sm="12" :xs="24" class="column">
            <div class="ft_widgets">
              <h6 class="title1">联系我们</h6>
              <ul class="menu">
                <li v-for="item in contactList" :key="item.id">
                  <a href="/contact" v-html="item.content"></a>
                </li>
              </ul>
            </div>
          </el-col>
        </el-row>

        <!-- 版权信息 -->
        <el-row :gutter="30">
          <el-col :span="24" class="copyright">
            &copy; {{ new Date().getFullYear() }} 公司名称. 保留所有权利。
          </el-col>
        </el-row>
      </div>
    </footer>
    <!-- Footer End -->
  </div>
</template>

<script>
import { homeListCases, updateCases } from "@/api/achievement/cases"
import '@fortawesome/fontawesome-free/css/all.css'
export default {
  data() {
    return {
      description: '',
      casesList: [],
      services: [],
      contactList: [],
      totalCount: 0,
      currentSlide: 0, // 当前激活的轮播索引
      mainMenu: [
        {
          title: '首页',
          href: '/home'
        },
        {
          title: '关于',
          href: '/about'
        },
        {
          title: '服务',
          href: '/services',
        },
        {
          title: '博客',
          href: '#',
          children: [
            {
              title: '博客网络',
              href: '#',
              children: [
                { title: '全宽', href: '/blog-grid' },
                { title: '左侧边栏', href: '/blog-grid-left' },
                { title: '右侧边栏', href: '/blog-grid-right' }
              ]
            },
          ]
        },
        {
          title: '联系我们',
          href: '/contact'
        }
      ]
    };
  },
  created() {
    // 在组件创建时调用获取数据的方法
    this.fetchShowData();
    this.fetchHomeServices();
  },
  computed: {
    // 只显示 type 为 'project' 的轮播项
    projectSlides() {
      return this.casesList.filter(item => item.type === 'project');
    },
    aboutItem() {
      // 从 casesList 中查找 type 为 'about' 的项
      const item = this.casesList.find(c => c.type === 'about');
      return item || null;
    },
    totalSlides() {
      return this.projectSlides.length;
    },
    currentSlideStr() {
      // 格式化为 01, 02, 03...
      return String(this.currentSlide + 1).padStart(2, '0');
    }
  },
  mounted() {
    this.fetchShowData(); // 加载组件时获取数据
    this.fetchAboutContent();
    this.fetchContactInfo();
  },
  methods: {
    fetchContactInfo() {
      const params = {
        type: 'contact',
        isPublished: 1,
        pageSize: 10
      };

      homeListCases(params)
        .then(response => {
          console.log('【联系方式返回】:', response);

          if (response.rows && response.rows.length > 0) {
            // 将每条数据整理成 { id, content, coverImage } 格式
            this.contactList = response.rows.map(item => ({
              id: item.id,
              content: item.content || '',
              coverImage: item.coverImage || ''
            }));
          } else {
            this.contactList = []; // 没有数据
          }
        })
        .catch(error => {
          console.error('加载联系方式失败:', error);
          this.contactList = []; // 失败时为空
        });
    },
    fetchAboutContent() {
      const params = {
        type: 'about',    // ✅ 只获取类型为 about 的数据
        isPublished: 1,   // 只获取已发布的
        pageSize: 1       // 只获取一条数据
      };
      homeListCases(params) // 👈 替换为您的实际接口方法
        .then(response => {
          console.log('接口返回:', response);
          this.description = response.rows[0].content;
        })
        .catch(err => {
          console.error('请求失败:', err);
        });
    },
    fetchHomeServices() {
      const params = {
        type: 'home-service',    // ✅ 只获取类型为 home-service 的数据
        isPublished: 1,          // 只获取已发布的
        pageSize: 10             // 可根据需要限制数量
      };

      // 调用您的 API 接口
      homeListCases(params) // 👈 替换为您的实际接口方法
        .then(response => {
          // 假设 response.rows 是数据列表
          this.services = response.rows || response.data || [];
        })
        .catch(error => {
          console.error('加载服务失败:', error);
          this.services = [];
        });
    },
    goToBlogDetails(id) {
      const blog = this.casesList.find(c => c.id === id);
      if (blog) {
        const data = {
          id: blog.id,
          viewCount: (blog.viewCount || 0)  + 1
        };
        updateCases(data).then(() => {
          console.log(`博客 ${id} 阅读量已 +1`);
        }).catch(err => {
          console.error('更新失败:', err);
        }).finally(() => {
          // 无论成功失败都跳转
          this.$router.push({ path: `/blog-details/${id}` });
        });
      } else {
        this.$router.push({ path: `/blog-details/${id}` });
      }
    },
    fixImgUrl(path) {
      if (!path) return '';
      return path.startsWith(process.env.VUE_APP_BASE_API) ? encodeURI(path) : encodeURI(process.env.VUE_APP_BASE_API + path);
    },
    async fetchShowData() {
      try {
        // 假设 showCases 现在正确获取列表
        const response = await homeListCases({
          // 根据实际 API 要求传参，比如分页
          pageNum: 1,
          pageSize: 10,
          isFeatured: 1,
          isPublished: 1
        });
        console.log('API 响应:', response);

        // ✅ 安全检查：确保 response, response.data, response.data.rows 都存在
        if (response && response.rows) {
          this.casesList = Array.isArray(response.rows) ? response.rows : [response.rows];
          this.totalCount = response.total || 0;
          console.log('获取案例成功:', this.casesList);
        } else {
          console.warn('API 响应缺少必要的数据字段:', response);
          // this.casesList 和 this.totalCount 已经是初始值，无需再赋
        }

      } catch (error) {
        // ✅ 现在 catch 块是安全的，不会因为读取 undefined 而崩溃
        console.error('获取案例失败:', error);
        // 数据已在上面初始化，这里可以保持不变或再次重置
      }
    },
    // 监听轮播切换
    handleSlideChange(index) {
      this.currentSlide = index;
    },
    // 点击小点跳转到对应幻灯片
    goToSlide(index) {
      this.$refs.carousel.setActiveItem(index);
    },
    handleMenuClick(item, event) {
      // 如果有子菜单，阻止跳转，用于展开/收起
      if (item.children) {
        event.preventDefault();
        // 可以在这里添加展开/收起逻辑（比如维护一个展开状态数组）
        console.log('Toggle submenu for:', item.title);
      }
      // 否则允许正常跳转
    }
  }
};
</script>

<style scoped>
/* 全局重置与字体 */
#app {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

/* 容器居中，类似 Bootstrap */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.btn-view-details {
  /* 布局与尺寸 */
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;

  /* 背景与颜色 */
  color: #fff;
  background: linear-gradient(135deg, #1abc9c 0%, #2ecc71 100%);
  border: none;
  border-radius: 30px;

  /* 阴影与层次 */
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
  transition: all 0.3s ease;

  /* 光标与交互 */
  cursor: pointer;
  outline: none;
}

/* 悬停效果 */
.btn-view-details:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
  background: linear-gradient(135deg, #16a085 0%, #27ae60 100%);
}

/* 按下效果 */
.btn-view-details:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}


.services {
  padding: 60px 20px;
  text-align: center;
}

.services h2 {
  font-size: 2.5rem;
  color: #111;
  margin-bottom: 40px;
  font-weight: 600;
}

.service_boxes {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap; /* 允许在小屏幕下换行 */
}

.service_box {
  display: block;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: all 0.3s ease;
  color: #333;
  text-align: center;
  width: calc(33% - 20px); /* 每个盒子占25%，减去间距 */
  margin: 0 10px;
}

.service_box:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.icon {
  font-size: 50px;
  color: #007bff;
  margin-bottom: 16px;
}

.title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111;
}

.text {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
}

/* 响应式：适配平板与手机 */
@media (max-width: 992px) {
  .service_box {
    width: calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .service_box {
    width: 100%;
    margin: 10px 0;
  }
}

/* =============
   Header 样式
============= */
.header {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  position: relative;
  z-index: 1000;
}

.header.can-sticky {
  position: sticky;
  top: 0;
  transition: all 0.3s ease;
}

.logo img {
  height: 50px;
  transition: all 0.3s ease;
}

.logo img:hover {
  opacity: 0.9;
}

/* 导航栏 - 主菜单 */
.navigation {
  display: flex;
  justify-content: center;
}

.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
  align-items: center;
}

.main-menu > .menu-item {
  position: relative;
}

.main-menu > .menu-item > a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 16px;
  transition: color 0.3s ease;
  padding: 5px 0;
  display: block;
}

.main-menu > .menu-item > a:hover,
.main-menu > .menu-item > a.active {
  color: #0066ff;
}

/* 二级菜单 */
.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  z-index: 1001;
}

.menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sub-menu .menu-item {
  padding: 0;
}

.sub-menu .menu-item > a {
  color: #555;
  padding: 10px 20px;
  font-size: 15px;
  display: block;
  transition: background 0.3s ease, color 0.3s ease;
}

.sub-menu .menu-item > a:hover {
  background-color: #f5f9ff;
  color: #0066ff;
  padding-left: 24px;
}

/* 三级菜单 */
.sub-menu .sub-menu {
  left: 100%;
  top: 5px;
}

/* 登录按钮 */
.header_btn {
  background-color: #0066ff;
  color: #fff !important;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  border: none;
  outline: none;
}

.header_btn:hover {
  background-color: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

/* 基础间距 */
.mb-30 {
  margin-bottom: 30px;
}

/* Service Box 样式 */
.service_box {
  display: flex;           /* 改为 flex 布局 */
  flex-direction: column;  /* 子元素垂直排列 */
  align-items: center;     /* ✅ 水平居中（关键！） */
  text-align: center;      /* ✅ 文字内容居中 */
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: all 0.3s ease;
  color: #333;
  /* 移除固定高度，让内容自适应 */
}

.service_box:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.contact-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.service_box:hover .contact-icon img {
  transform: scale(1.1);
}

.title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111;
}

.text {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
}

/* 响应式 */
@media (max-width: 992px) {
  .el-col-md-12 {
    max-width: 100%;
    flex: 0 0 100%;
  }
}

/* 外边距 */
.mb-xl-30 {
  margin-bottom: 30px;
}

/* 响应式图片 */
.image-fit {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.thm-btn {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease;
  margin-top: 20px;
}

.thm-btn:hover {
  background-color: #0056b3;
}

/* 响应式调整 */
@media (max-width: 992px) {
  .section-header .title {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .el-row {
    flex-direction: column-reverse;
  }

  .mb-xl-30 {
    margin-bottom: 20px;
  }
}

.mb-xl-30 {
  margin-bottom: 30px;
}

.mb-30 {
  margin-bottom: 30px;
}

.icon_box i {
  font-size: 40px;
  color: #007bff;
}

.icon_box .title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.thm-btn {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  text-align: center;
  font-weight: 500;
  margin-top: 20px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.thm-btn:hover {
  background-color: #0056b3;
}

/* 响应式 */
@media (max-width: 768px) {
  .mb-xl-30 {
    margin-bottom: 20px;
  }
}

.container {
  width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.header {
  padding: 20px 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo img {
  height: 50px;
}

.main-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 30px;
}

.main-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.main-menu a.active {
  color: #007bff;
}

.banner_image {
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  color: #fff;
}

.slide-item {
  position: relative;
  width: 100%;
  height: 80vh;
  overflow: hidden;
}

.banner_image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.banner_text {
  position: absolute;
  bottom: 0; /* 将文本定位在图片底部 */
  left: 0;
  right: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5); /* 半透明背景色 */
  text-align: center;
}

/* 调整 title 和 subtitle 的样式 */
.title0 {
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
  color: gold; /* 金色字体 */
}

.subtitle0 {
  font-size: 1.5rem; /* 增加字体大小 */
  opacity: 0.9;
  margin: 0;
  color: #090909; /* 或者根据需要选择其他颜色 */
}

.thm-btn {
  display: inline-block;
  padding: 10px 30px;
  margin-top: 20px;
  background-color: #007bff; /* 蓝色按钮背景 */
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.thm-btn:hover {
  background-color: #0056b3; /* 更深的蓝色 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 自定义底部指示器样式 */
.dots_counts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
  color: #333;
}

.slider-count .current {
  font-size: 1.5rem;
  font-weight: 700;
}

.slick-slider-dots ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
}

.slick-slider-dots li {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
  transition: all 0.3s;
}

.slick-slider-dots li.active {
  background-color: #007bff;
  transform: scale(1.2);
}

.section-padding {
  padding: 80px 0;
}

.about-content h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.about-content p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.image-fit {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.main-menu,
.sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-menu {
  display: flex;
  gap: 30px;
}

.sub-menu {
  display: none;
  padding-left: 20px;
}

.menu-item-has-children:hover > .sub-menu {
  display: block;
}

.menu-item a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  display: block;
  padding: 8px 0;
}

.menu-item a:hover {
  color: #007bff;
}

/* 活跃菜单样式 */
.menu-item.active a {
  color: #007bff;
  font-weight: 600;
}

.footer {
  background-color: black;
  color: #fff;
  padding: 60px 0;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.column {
  margin-bottom: 30px;
}

.logo {
  height: 40px;
  margin-bottom: 15px;
}

.description {
  color: #ccc;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 300px;
}

.social-icons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-icons .icon {
  color: #fff;
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #222;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.title1 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.menu li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.menu li a:hover {
  color: #fff;
}

.copyright {
  text-align: center;
  margin-top: 30px;
  color: #777;
  font-size: 13px;
  border-top: 1px solid #222;
  padding-top: 15px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  object-fit: contain; /* 确保图片完整显示 */
  margin: 0 auto 12px;
  display: block;
}
</style>
